/*************************************************
Author: will
Date: 11/13/2012
Description:
Notes: 
*************************************************/

#ifndef __CSoulConfig_h__
#define __CSoulConfig_h__

#include "commclass.h"
#include "CTArray.h"

class CSoulBallConfigData
{
public:
    CSoulBallConfigData()
        :_bHasConfig(false)
    {
        _ucBallID = 0;
        _astTotalAttr.m_iUsedCount = _astTotalAttr.GetCount();
        _astLevelAttr.m_iUsedCount = _astLevelAttr.GetCount();
    }

    int AddBallAttr(unsigned char ucBallLevel, CPlayerAttr& stPlayerAttr);

    int GetBallLevelAttr(unsigned char ucBallLevel, CPlayerAttr& stPlayerAttr);

    int GetBallTotalAttr(unsigned char ucBallLevel, CPlayerAttr& stPlayerAttr);

public:
    bool _bHasConfig;

    unsigned char _ucBallID;
    CTLib::CTArray<CPlayerAttr, MAX_SOUL_MAX_BALL_LEVEL + 1> _astTotalAttr;     //每级累进配置
    CTLib::CTArray<CPlayerAttr, MAX_SOUL_MAX_BALL_LEVEL + 1> _astLevelAttr;     //每级配置
};

class CSoulBallConfig
{
public:
    CSoulBallConfig()
    {

    }

    int AddConfig(CSoulBallConfigData& stConfigData);

    int GetConfig(unsigned char ucBallID, CSoulBallConfigData& stConfigData);

public:
    CTLib::CTArray<CSoulBallConfigData, MAX_SOUL_MAX_BALL_COUNT + 1> _astBalls;
};

class CSoulStatConfigData
{
public:
    CSoulStatConfigData()
    {

    }

    unsigned int GetSkillIDByCareer(unsigned char ucCareer)
    {
        switch(ucCareer)
        {
        case CAREER_1:
            return _usSkillID1;
        case CAREER_2:
            return _usSkillID2;
        case CAREER_3:
            return _usSkillID3;
        default:
            return 0;
        }

        return 0;
    }

public:
    bool _bHasConfig;

    unsigned char _ucStatID;
    unsigned short _usNeedLevel;
    unsigned short _usNeedHunli;
    unsigned int _usSkillID1;
    unsigned int _usSkillID2;
    unsigned int _usSkillID3;
    CTArray<unsigned char, MAX_SOUL_MAX_BALL_COUNT> _astBallIDs;
};

class CSoulStatConfig
{
public:
    CSoulStatConfig()
        :_ucMaxStatID(0)
    {
        _astStatDatas.m_iUsedCount = _astStatDatas.GetCount();
        _astTotalAttr.m_iUsedCount = _astTotalAttr.GetCount();
    }

    int AddConfig(CSoulStatConfigData& stConfigData, CSoulBallConfig& stSoulBallConfig);
    int GetConfig(unsigned char ucStatID, CSoulStatConfigData& stConfigData);
    
    int GetStatTotalAttr(unsigned ucStatID, CPlayerAttr& stAttr);

public:
    unsigned char _ucMaxStatID;
    CTLib::CTArray<CSoulStatConfigData, MAX_SOUL_STAT_LEVEL + 1> _astStatDatas;
    CTLib::CTArray<CPlayerAttr, MAX_SOUL_STAT_LEVEL + 1> _astTotalAttr;     
};


#endif // __CSoulConfig_h__

